<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>10-字符串相关</title>
</head>
<body>
    <script>
        //substring(start,end);  截取的是start到end的字符串
        let str = 'helloworld!';
        let newstr = str.substring(0,3);
        console.log(newstr);//hel
        let ostr = 'chinaxian'.substring(1);
        console.log(ostr);//hinaxian

        //
        let locationx = 'www.baidu.com';
        var arr = locationx.split(".");
        console.log(arr);//Array(3) [ "www", "baidu", "com" ]


        


    </script>
</body>
</html>